// 互相引用
function objGroup(obj1, obj2) {
  // obj1 & obj2 各自通过一个对象指向彼此
  obj1.next = obj2
  obj2.next = obj1

  return {
    o1: obj1,
    o2: obj2,
  }
}
let obj = objGroup({ name: 'obj1' }, { name: 'obj2' })
console.log(obj)
/*
打印结果
{
  o1: { name: 'obj1', next: { name: 'obj2', next: [Circular] } },
  o2: { name: 'obj2', next: { name: 'obj1', next: [Circular] } }
}
*/